
const tokens = {
  admin: {
    token: 'admin-token'
  },
  editor: {
    token: 'editor-token'
  },
  test: {
    token: 'test-token'
  }
}

const users = {
  'admin-token': {
    roles: ['admin'],
    introduction: 'I am a super administrator',
    avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
    name: 'Super Admin'
  },
  'editor-token': {
    roles: ['editor'],
    introduction: 'I am an editor',
    avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
    name: 'Normal Editor'
  },
  'test-token': {
    roles: ['test'],
    introduction: 'I am an test',
    avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
    name: 'test Editor'
  }
}

export default [
  // user login
  {
    url: '/user/login',
    type: 'post',
    response: config => {
      const { username } = config.body
      const token = tokens[username]
      // mock error
      // if (!token) {
      //
      //   return {
      //     IsSuccess: 0,
      //     Data:{message: 'Account and password are incorrect.'}
      //   }
      // }
      // else{
      //
      // }
      return {
        code: 1,
        msg:'成功',
        data: {
          token:token,
          "expires_in": 0,
          "refresh_token": "string",
          "user_id": 0}
      }
    }
  },

  // get user info
  {
    url: '/menu/get-sys-menu-by-user',
    type: 'post',
    response: config => {
      const { token } = config.query
      const info = users[token]
      // mock error
     {
      return {
        code: 1,
        msg:'成功',
        data: {
          page:[
            {
              path: '/',
              component: 'Layout',
              redirect: '/home',
              children: [{
                path: '/home',
                name: 'home',
                component: ('/service/home'),
                meta: { title: '殡葬服务', icon: 'dashboard',button:{'one':true,'two':true,'three':true,'four':true,'five':true,'six':true,'seven':true} }
              }]
            },
            {
              path: '/service',
              component: 'Layout',
              redirect: '/home',
              name: 'service',
              meta: { title: '殡仪馆服务办理', icon: 'tree' },
              children: [
                {
                  path: '/home',
                  name: 'home',
                  component: ('/service/home'),
                  meta: { title: '火化档案', icon: 'table' }
                },
                {
                  path: '/Service',
                  name: 'Service',
                  component: ('/service/Service'),
                  meta: { title: '服务洽谈', icon: 'table' }
                },
                {
                  path: '/TotalMoney',
                  name: 'TotalMoney',
                  component: ('/service/TotalMoney'),
                  meta: { title: '费用结算', icon: 'table' }
                },
                {
                  path: '/PrintReplace',
                  name: 'PrintReplace',
                  component: ('/service/PrintReplace'),
                  meta: { title: '火化证打印补办', icon: 'table' }
                },
                {
                  path: '/PhotoArchiva',
                  name: 'PhotoArchiva',
                  component: ('/service/PhotoArchival'),
                  meta: { title: '拍照备案', icon: 'table' }
                },
                {
                  path: '/DayPayment',
                  name: 'DayPayment',
                  component: ('/service/DayPayment'),
                  meta: { title: '费用日结/交账', icon: 'drag' }
                }
              ]
            },
            {
              path: '/business',
              component: 'Layout',
              redirect: '/FileManagement',
              name: 'business',
              meta: { title: '殡仪馆业务办理', icon: 'tree' },
              children: [

                {
                  path: '/FileManagement',
                  name: 'FileManagement',
                  component: ('/business/FileManagement'),
                  meta: { title: '火化档案查询', icon: 'table' }
                },
                {
                  path: '/Costquery',
                  name: 'Costquery',
                  component: ('/business/Costquery'),
                  meta: { title: '费用查询', icon: 'table' }
                },
                {
                  path: '/RevenueStatistics',
                  name: 'RevenueStatistics',
                  component: ('/business/RevenueStatistics'),
                  meta: { title: '殡仪馆收入查询', icon: 'table' }
                },
                {
                  path: '/PreferentialRelief',
                  name: 'PreferentialRelief',
                  component: ('/business/PreferentialRelief'),
                  meta: {title: '优惠减免统计报表', icon: 'table'}
                },
                {
                  path: '/CremationData',
                  name: 'CremationData',
                  component: ('/business/CremationData'),
                  meta: { title: '火化数据查询', icon: 'table' }
                },
                {
                  path: '/CremationLedger',
                  name: 'CremationLedger',
                  component: ('/business/CremationLedger'),
                  meta: { title: '火化台账查询', icon: 'table' }
                },
                {
                  path: '/Refrigeration',
                  name: 'Refrigeration',
                  component: ('/business/Refrigeration'),
                  meta: { title: '冷藏业务查询', icon: 'table' }
                },
                {
                  path: '/CeremonyHall',
                  name: 'CeremonyHall',
                  component: ('/business/CeremonyHall'),
                  meta: { title: '礼厅业务查询', icon: 'table' }
                },
                {
                  path: '/Overview',
                  name: 'Overview',
                  component: ('/business/Overview'),
                  meta: { title: '殡仪馆实时业务总览', icon: 'table' }
                },
                {
                  path: '/CremationRecord',
                  name: 'CremationRecord',
                  component: ('/datastatistics/CremationRecord'),
                  meta: { title: '殡仪火化记录统计', icon: 'table' }
                },
                {
                  path: '/ServiceSale',
                  name: 'ServiceSale',
                  component: ('/datastatistics/ServiceSale'),
                  meta: { title: '业务销售统计', icon: 'table' }
                },
                {
                  path: '/Exemption',
                  name: 'Exemption',
                  component: ('/datastatistics/Exemption'),
                  meta: { title: '减免统计', icon: 'table' }
                },
              ]
            },
            {
              path: '/setting',
              component: 'Layout',
              redirect: '/SystemSetup',
              name: 'setting',
              meta: { title: '系统设置与监控', icon: 'tree' },
              children: [
                {
                  path: '/SystemSetup',
                  name: 'SystemSetup',
                  component: ('/setting/SystemSetup'),
                  meta: { title: '系统设置', icon: 'table' }
                },
                {
                  path: '/DatabaseBackup',
                  name: 'DatabaseBackup',
                  component: ('/setting/DatabaseBackup'),
                  meta: { title: '数据库备份监控', icon: 'table' }
                },
                {
                  path: '/SystemLog',
                  name: 'SystemLog',
                  component: ('/setting/SystemLog'),
                  meta: { title: '系统日志', icon: 'table' }
                }
              ]
            },
          ],
          button:[0,1,2,3,4,5]
        },
      }
      }
    }
  },

  // user logout
  {
    url: '/user/logout',
    type: 'post',
    response: _ => {
      return {
        code: 1,
        msg:'成功',
        data: 'success'
      }
    }
  },
  // 字典数据
  {
    url: '/dictionary/get-dictionary',
    type: 'post',
    response: _ => {
      return {
        code: 1,
        msg: "字典加载成功",
        data: {
          "sex": [
            {
              "code": "0",
              "text": "未知",
              "meaning": "未知的性别"
            },
            {
              "code": "1",
              "text": "男",
              "meaning": "男性"
            },
            {
              "code": "2",
              "text": "女",
              "meaning": "女性"
            },
            {
              "code": "9",
              "text": "",
              "meaning": "未说明的性别"
            }
          ],
          "certificates": [
            {
              "code": "1",
              "text": "内地居民身份证",
              "meaning": "内地居民身份证"
            },
            {
              "code": "2",
              "text": "香港居民身份证",
              "meaning": "香港居民身份证"
            },
            {
              "code": "3",
              "text": "澳门居民身份证",
              "meaning": "澳门居民身份证"
            },
            {
              "code": "4",
              "text": "台湾居民身份证",
              "meaning": "台湾居民身份证"
            },
            {
              "code": "5",
              "text": "护照",
              "meaning": "护照"
            },
            {
              "code": "6",
              "text": "军官证",
              "meaning": "军官证"
            },
            {
              "code": "7",
              "text": "士兵证",
              "meaning": "士兵证"
            },
            {
              "code": "8",
              "text": "其他有效国籍旅行证件",
              "meaning": "其他有效国籍旅行证件"
            }
          ],
          "nationality": [
            {
              "code": "156",
              "text": "中国",
              "meaning": "中国"
            },
            {
              "code": "999",
              "text": "其他",
              "meaning": "其他国家"
            }
          ],
          "domicile": [
            {
              "code": "0",
              "text": "无户籍",
              "meaning": "无户籍人员"
            },
            {
              "code": "1",
              "text": "农业户口",
              "meaning": "农业户口"
            },
            {
              "code": "2",
              "text": "非农业户口",
              "meaning": "非农业户口"
            }
          ],
          "nation": [
            {
              "code": "1",
              "text": "汉族",
              "meaning": "汉族"
            },
            {
              "code": "2",
              "text": "蒙古族",
              "meaning": "蒙古族"
            },
            {
              "code": "3",
              "text": "回族",
              "meaning": "回族"
            },
            {
              "code": "4",
              "text": "藏族",
              "meaning": "藏族"
            },
            {
              "code": "5",
              "text": "维吾尔族",
              "meaning": "维吾尔族"
            },
            {
              "code": "6",
              "text": "苗族",
              "meaning": "苗族"
            },
            {
              "code": "7",
              "text": "彝族",
              "meaning": "彝族"
            },
            {
              "code": "8",
              "text": "壮族",
              "meaning": "壮族"
            },
            {
              "code": "9",
              "text": "布依族",
              "meaning": "布依族"
            },
            {
              "code": "10",
              "text": "朝鲜族",
              "meaning": "朝鲜族"
            },
            {
              "code": "11",
              "text": "满族",
              "meaning": "满族"
            },
            {
              "code": "12",
              "text": "侗族",
              "meaning": "侗族"
            },
            {
              "code": "13",
              "text": "瑶族",
              "meaning": "瑶族"
            },
            {
              "code": "14",
              "text": "白族",
              "meaning": "白族"
            },
            {
              "code": "15",
              "text": "土家族",
              "meaning": "土家族"
            },
            {
              "code": "16",
              "text": "哈尼族",
              "meaning": "哈尼族"
            },
            {
              "code": "17",
              "text": "哈萨克族",
              "meaning": "哈萨克族"
            },
            {
              "code": "18",
              "text": "傣族",
              "meaning": "傣族"
            },
            {
              "code": "19",
              "text": "黎族",
              "meaning": "黎族"
            },
            {
              "code": "20",
              "text": "傈僳族",
              "meaning": "傈僳族"
            },
            {
              "code": "21",
              "text": "佤族",
              "meaning": "佤族"
            },
            {
              "code": "22",
              "text": "畲族",
              "meaning": "畲族"
            },
            {
              "code": "23",
              "text": "高山族",
              "meaning": "高山族"
            },
            {
              "code": "24",
              "text": "拉祜族",
              "meaning": "拉祜族"
            },
            {
              "code": "25",
              "text": "水族",
              "meaning": "水族"
            },
            {
              "code": "26",
              "text": "东乡族",
              "meaning": "东乡族"
            },
            {
              "code": "27",
              "text": "纳西族",
              "meaning": "纳西族"
            },
            {
              "code": "28",
              "text": "景颇族",
              "meaning": "景颇族"
            },
            {
              "code": "29",
              "text": "柯尔克孜族",
              "meaning": "柯尔克孜族"
            },
            {
              "code": "30",
              "text": "土族",
              "meaning": "土族"
            },
            {
              "code": "31",
              "text": "达斡尔族",
              "meaning": "达斡尔族"
            },
            {
              "code": "32",
              "text": "仫佬族",
              "meaning": "仫佬族"
            },
            {
              "code": "33",
              "text": "羌族",
              "meaning": "羌族"
            },
            {
              "code": "34",
              "text": "布朗族",
              "meaning": "布朗族"
            },
            {
              "code": "35",
              "text": "撤拉族",
              "meaning": "撤拉族"
            },
            {
              "code": "36",
              "text": "毛难族",
              "meaning": "毛难族"
            },
            {
              "code": "37",
              "text": "仡佬族",
              "meaning": "仡佬族"
            },
            {
              "code": "38",
              "text": "锡伯族",
              "meaning": "锡伯族"
            },
            {
              "code": "39",
              "text": "阿昌族",
              "meaning": "阿昌族"
            },
            {
              "code": "40",
              "text": "普米族",
              "meaning": "普米族"
            },
            {
              "code": "41",
              "text": "塔吉克族",
              "meaning": "塔吉克族"
            },
            {
              "code": "42",
              "text": "怒族",
              "meaning": "怒族"
            },
            {
              "code": "43",
              "text": "乌孜别克族",
              "meaning": "乌孜别克族"
            },
            {
              "code": "44",
              "text": "俄罗斯族",
              "meaning": "俄罗斯族"
            },
            {
              "code": "45",
              "text": "鄂温克族",
              "meaning": "鄂温克族"
            },
            {
              "code": "46",
              "text": "德昂族",
              "meaning": "德昂族"
            },
            {
              "code": "47",
              "text": "保安族",
              "meaning": "保安族"
            },
            {
              "code": "48",
              "text": "裕固族",
              "meaning": "裕固族"
            },
            {
              "code": "49",
              "text": "京族",
              "meaning": "京族"
            },
            {
              "code": "50",
              "text": "塔塔尔族",
              "meaning": "塔塔尔族"
            },
            {
              "code": "51",
              "text": "独龙族",
              "meaning": "独龙族"
            },
            {
              "code": "52",
              "text": "鄂伦春族",
              "meaning": "鄂伦春族"
            },
            {
              "code": "53",
              "text": "赫哲族",
              "meaning": "赫哲族"
            },
            {
              "code": "54",
              "text": "门巴族",
              "meaning": "门巴族"
            },
            {
              "code": "55",
              "text": "珞巴族",
              "meaning": "珞巴族"
            },
            {
              "code": "56",
              "text": "基诺族",
              "meaning": "基诺族"
            },
            {
              "code": "97",
              "text": "其他",
              "meaning": "其他"
            },
            {
              "code": "98",
              "text": "外国血统中国籍人士",
              "meaning": "外国血统中国籍人士"
            }
          ],
          "type_of_death": [
            {
              "code": "0",
              "text": "逝者（含尸骨）",
              "meaning": "逝者（含尸骨）"
            },
            {
              "code": "1",
              "text": "无名尸（含尸骨）",
              "meaning": "无名尸（含尸骨）"
            },
            {
              "code": "2",
              "text": "福利院供养的三无对象",
              "meaning": "福利院供养的三无对象"
            },
            {
              "code": "3",
              "text": "福利院抚养的孤残儿童",
              "meaning": "福利院抚养的孤残儿童"
            },
            {
              "code": "4",
              "text": "现役军人",
              "meaning": "现役军人"
            },
            {
              "code": "5",
              "text": "在押人员、保外就医人员",
              "meaning": "在押人员、保外就医人员"
            },
            {
              "code": "6",
              "text": "医院标本",
              "meaning": "医院标本"
            },
            {
              "code": "7",
              "text": "医院早产儿",
              "meaning": "医院早产儿"
            },
            {
              "code": "8",
              "text": "当事人（残肢）",
              "meaning": "当事人（残肢）"
            },
            {
              "code": "9",
              "text": "华侨",
              "meaning": "华侨"
            }
          ],
          "cremation_type": [
            {
              "code": "1",
              "text": "遗体",
              "meaning": "遗体"
            },
            {
              "code": "2",
              "text": "标本",
              "meaning": "标本"
            },
            {
              "code": "3",
              "text": "胎儿",
              "meaning": "胎儿"
            },
            {
              "code": "4",
              "text": "残肢",
              "meaning": "残肢"
            },
            {
              "code": "99",
              "text": "其它",
              "meaning": "其它"
            }
          ],
          "remains_state": [
            {
              "code": "1",
              "text": "完好",
              "meaning": "完好"
            },
            {
              "code": "2",
              "text": "腐败",
              "meaning": "腐败"
            },
            {
              "code": "3",
              "text": "缺失",
              "meaning": "缺失"
            },
            {
              "code": "4",
              "text": "标本",
              "meaning": "标本"
            },
            {
              "code": "5",
              "text": "遗骸",
              "meaning": "遗骸"
            },
            {
              "code": "99",
              "text": "其它",
              "meaning": "其它"
            }
          ],
          "cause_of_death": [
            {
              "code": "1",
              "text": "自然死亡",
              "meaning": "自然死亡"
            },
            {
              "code": "2",
              "text": "病故",
              "meaning": "病故"
            },
            {
              "code": "3",
              "text": "事故",
              "meaning": "事故"
            },
            {
              "code": "4",
              "text": "车祸",
              "meaning": "车祸"
            },
            {
              "code": "5",
              "text": "他杀",
              "meaning": "他杀"
            },
            {
              "code": "6",
              "text": "自杀",
              "meaning": "自杀"
            },
            {
              "code": "7",
              "text": "溺水",
              "meaning": "溺水"
            },
            {
              "code": "8",
              "text": "中毒",
              "meaning": "中毒"
            },
            {
              "code": "9",
              "text": "自然灾害",
              "meaning": "自然灾害"
            },
            {
              "code": "99",
              "text": "其它",
              "meaning": "其它"
            }
          ],
          "treatment_of_ashes": [
            {
              "code": "1",
              "text": "寄存",
              "meaning": "寄存"
            },
            {
              "code": "2",
              "text": "埋葬",
              "meaning": "埋葬"
            },
            {
              "code": "3",
              "text": "不要",
              "meaning": "不要"
            },
            {
              "code": "4",
              "text": "抛撒",
              "meaning": "抛撒"
            }
          ],
          "huimin_region": null,
          "exemption_type": [
            {
              "code": "1",
              "text": "本地户籍居民",
              "meaning": "本地户籍居民"
            },
            {
              "code": "2",
              "text": "城乡低保对象",
              "meaning": "城乡低保对象"
            },
            {
              "code": "3",
              "text": "农村五保对象",
              "meaning": "农村五保对象"
            },
            {
              "code": "4",
              "text": "城市“三无”人员",
              "meaning": "城市“三无”人员"
            },
            {
              "code": "5",
              "text": "优抚对象",
              "meaning": "优抚对象"
            },
            {
              "code": "6",
              "text": "因灾死亡人员",
              "meaning": "因灾死亡人员"
            },
            {
              "code": "7",
              "text": "无名尸体",
              "meaning": "无名尸体"
            },
            {
              "code": "8",
              "text": "福利救助机构收养救助的人员",
              "meaning": "福利救助机构收养救助的人员"
            },
            {
              "code": "9",
              "text": "非本地户籍大中专学生",
              "meaning": "非本地户籍大中专学生"
            },
            {
              "code": "10",
              "text": "驻本地现役军人",
              "meaning": "驻本地现役军人"
            },
            {
              "code": "11",
              "text": "外来务工人员",
              "meaning": "外来务工人员"
            },
            {
              "code": "99",
              "text": "其他选项",
              "meaning": "其他选项"
            }
          ],
          "mode_with_carry": [
            {
              "code": "1",
              "text": "本馆接运",
              "meaning": "本馆接运"
            },
            {
              "code": "2",
              "text": "外馆送达",
              "meaning": "外馆送达"
            },
            {
              "code": "3",
              "text": "服务站送达",
              "meaning": "服务站送达"
            },
            {
              "code": "4",
              "text": "外单位送达",
              "meaning": "外单位送达"
            },
            {
              "code": "5",
              "text": "个体接运",
              "meaning": "个体接运"
            },
            {
              "code": "6",
              "text": "本村接运",
              "meaning": "本村接运"
            }
          ],
          "relationship_with_decea": null,
          "funeral_unit_type": [
            {
              "code": "1",
              "text": "殡仪馆",
              "meaning": "殡仪馆"
            },
            {
              "code": "2",
              "text": "公墓",
              "meaning": "公墓"
            },
            {
              "code": "3",
              "text": "殡葬服务机构",
              "meaning": "殡葬服务机构[备注：申请修改为“殡葬中介服务机构”]"
            },
            {
              "code": "4",
              "text": "殡葬用品生产销售单位",
              "meaning": "殡葬用品生产销售单位"
            },
            {
              "code": "5",
              "text": "公益性公墓",
              "meaning": "公益性公墓"
            },
            {
              "code": "6",
              "text": "骨灰堂",
              "meaning": "骨灰堂"
            },
            {
              "code": "7",
              "text": "红白理事会",
              "meaning": "红白理事会"
            },
            {
              "code": "8",
              "text": "殡仪服务站",
              "meaning": "殡仪服务站"
            },
            {
              "code": "9",
              "text": "殡葬执法队",
              "meaning": "殡葬执法队 [备注：申请修改为“殡葬执法机构”]"
            },
            {
              "code": "10",
              "text": "骨灰寄存设施",
              "meaning": "骨灰寄存设施[备注：申请建议取消]"
            },
            {
              "code": "11",
              "text": "火葬场",
              "meaning": "火葬场"
            },
            {
              "code": "12",
              "text": "殡葬管理所",
              "meaning": "殡葬管理所[备注：申请修改为“殡葬管理机构”]"
            },
            {
              "code": "13",
              "text": "经营性公墓",
              "meaning": "经营性公墓"
            },
            {
              "code": "14",
              "text": "城镇公益性公墓",
              "meaning": "城镇公益性公墓"
            },
            {
              "code": "15",
              "text": "农村公益性公墓",
              "meaning": "农村公益性公墓"
            },
            {
              "code": "16",
              "text": "殡葬社会组织",
              "meaning": "殡葬社会组织"
            },
            {
              "code": "17",
              "text": "殡葬科研机构",
              "meaning": "殡葬科研机构"
            },
            {
              "code": "18",
              "text": "殡葬教育机构",
              "meaning": "殡葬教育机构"
            },
            {
              "code": "99",
              "text": "其他",
              "meaning": "其他"
            }
          ]
        }
      }
    }
  }
]
